<?php

namespace app\api\model;

use app\common\model\Api;
use think\Model;

class User extends Api
{
    protected $autoWriteTimestamp = 'datetime';
    //用户ID，值，键
    public function tj($id,$status,$index,$bj = '='){
        $list = $this->field('id')->where([
            ['parent_id','=',$id],
            [$index,$bj,$status]
        ])->select();
        if($list){
            $list = count($list->toArray());
            return $list;
        }else{
            return 0;
        }
    }
}
